<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>Parallel Gaussian Process Regression: src/pgpr_data.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Parallel Gaussian Process Regression
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">The implementation of parallel Gaussian process (GP) regression is based on the following publication: Jie Chen, Nannan Cao, Kian Hsiang Low, Ruofei Ouyang, Colin Keng-Yan Tan &amp; Patrick Jaillet. Parallel Gaussian Process Regression with Low-Rank Covariance Matrix Approximations. In Proceedings of the 29th Conference on Uncertainty in Artificial Intelligence (UAI 2013), Bellevue, WA, Jul 11-15, 2013.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">pgpr_data.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="pgpr__data_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#ifndef _PGPR_DATA_H_</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#define _PGPR_DATA_H_</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pgpr__type_8h.html">pgpr_type.h</a>&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pgpr__util_8h.html">pgpr_util.h</a>&quot;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pgpr__parse_8h.html">pgpr_parse.h</a>&quot;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="pgpr__fgp_8h.html">pgpr_fgp.h</a>&quot;</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#define ALGO1 1 </span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#define ALGO2 2</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">//The index of an input starts from 1 </span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment">//The array index starts from 0</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#define s2i(s) (s-1) </span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="preprocessor">#define i2s(i) (i+1) </span></div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structt__state.html">   26</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structt__state.html">t_state</a> {</div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">   28</a></span>&#160;    <a class="code" href="classpgpr__vector.html">Vbool</a> <a class="code" href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">v_st</a>;</div>
<div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">   30</a></span>&#160;  Int <a class="code" href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">ss</a>;           </div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;</div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <a class="code" href="structt__state.html">t_state</a>() {</div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <a class="code" href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">ss</a> = 0;</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;  }</div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="structt__state.html#a42c55e66207116e6e78283fd50414a1c">   40</a></span>&#160;  <a class="code" href="structt__state.html#a42c55e66207116e6e78283fd50414a1c">t_state</a>(Int ds) {</div>
<div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    <a class="code" href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">v_st</a>.assign(ds, <span class="keyword">false</span>);</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;    <a class="code" href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">ss</a> = 0;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;  }</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;</div>
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structt__state.html#ac2e30425ac01de134c164fb1f2d11603">   49</a></span>&#160;  <span class="keywordtype">void</span> <a class="code" href="structt__state.html#ac2e30425ac01de134c164fb1f2d11603">init</a>(Int ds) {</div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;    <a class="code" href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">v_st</a>.assign(ds, <span class="keyword">false</span>);</div>
<div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;  }</div>
<div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structt__state.html#ac9637b03144741bb23da24c8ec61359b">   58</a></span>&#160;  <span class="keyword">inline</span> Bool <a class="code" href="structt__state.html#ac9637b03144741bb23da24c8ec61359b">getSt</a>(Int s) {</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    <span class="keywordflow">return</span> <a class="code" href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">v_st</a>[s2i(s)];</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;  }</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="structt__state.html#ad627540f74cd0836ea8b32ec9dd1c299">   66</a></span>&#160;  <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structt__state.html#ad627540f74cd0836ea8b32ec9dd1c299">upSt</a>(Int s) {</div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <a class="code" href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">v_st</a>[s2i(s)] = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    <a class="code" href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">ss</a>++;</div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;  }</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;};</div>
<div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="classpgpr__domain.html">   75</a></span>&#160;<span class="keyword">class </span><a class="code" href="classpgpr__domain.html">pgpr_domain</a></div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;{</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;  <a class="code" href="classpgpr__matrix.html">Mdoub</a> attr; <span class="comment">//attributs</span></div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;  <a class="code" href="classpgpr__matrix.html">Mint</a> ne;    <span class="comment">//topology information</span></div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  Int deg;    <span class="comment">//max degree </span></div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">   84</a></span>&#160;  Int <a class="code" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">dd</a>;     </div>
<div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">   86</a></span>&#160;  Int <a class="code" href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">ds</a>;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    </div>
<div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#ac527084df0c657962f29a554da0b3eea">   92</a></span>&#160;  <a class="code" href="classpgpr__domain.html#ac527084df0c657962f29a554da0b3eea">pgpr_domain</a>(<a class="code" href="classpgpr__matrix.html">Mint</a> n, <a class="code" href="classpgpr__matrix.html">Mdoub</a> a): ne(n), attr(a) {</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <a class="code" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">dd</a> = attr.ncols();</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <a class="code" href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">ds</a> = attr.nrows();</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;  }</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    </div>
<div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#ac24189f56e27aad49dee703f5a58cc9b">  101</a></span>&#160;  Doub <a class="code" href="classpgpr__domain.html#ac24189f56e27aad49dee703f5a58cc9b">getDist</a>(Int ci, Int cj) {</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    Doub sq_dist = 0;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    <span class="keywordflow">for</span>(Int i = 0; i &lt; <a class="code" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">dd</a> - 1; i++) {</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;      sq_dist += SQR(attr[ci][i] - attr[cj][i]);</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    }</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    <span class="keywordflow">return</span> SQRT(sq_dist);</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;  }</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div>
<div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">  112</a></span>&#160;    Int <a class="code" href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">selRand</a>(<a class="code" href="structt__state.html">t_state</a> *st) {</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    Int s = -1;</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="keywordflow">while</span>(st-&gt;<a class="code" href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">ss</a> &lt; <a class="code" href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">ds</a>) {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;      s = RANI(<a class="code" href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">ds</a> - 1) + 1;</div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;      <span class="keywordflow">if</span>((st-&gt;<a class="code" href="structt__state.html#ac9637b03144741bb23da24c8ec61359b">getSt</a>(s)) == 0 &amp;&amp; (attr[s - 1][<a class="code" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">dd</a> - 1] &gt;= 0)) {</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        st-&gt;<a class="code" href="structt__state.html#ad627540f74cd0836ea8b32ec9dd1c299">upSt</a>(s);</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;      }</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    }</div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    <span class="keywordflow">return</span> s;</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;  }</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#a55b740e3d3a4a0c5bf86cd14895cd76b">  127</a></span>&#160;    Int <a class="code" href="classpgpr__domain.html#a55b740e3d3a4a0c5bf86cd14895cd76b">getAttr</a>(Int s, Doub * a) {</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    takeSamp(attr[s - 1], a, <a class="code" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">dd</a>);</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;  }</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div>
<div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="classpgpr__domain.html#ae07953124466fffafd45013bd7917ddd">  139</a></span>&#160;  Int <a class="code" href="classpgpr__domain.html#ae07953124466fffafd45013bd7917ddd">getNeighbour</a>(Int s, <a class="code" href="classpgpr__vector.html">Vint</a> &amp;c) {</div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    Int num_c = ne[s - 1][0];</div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    c.resize(num_c);</div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    Int cur = 0;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    <span class="keywordflow">for</span> (Int i = 0; i &lt; num_c; i++) {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;      c[cur] = ne[s - 1][i + 1];</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;      cur++;</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;    }</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;    <span class="keywordflow">return</span> cur;</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;  }</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;};</div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classpgpr__data.html">  155</a></span>&#160;<span class="keyword">class </span><a class="code" href="classpgpr__data.html">pgpr_data</a></div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;{</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;  <a class="code" href="structt__state.html">t_state</a> *gst; <span class="comment">// Pointer to the status (e.g., selected or not) of domain data</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;  <a class="code" href="classpgpr__fgp.html">pgpr_fgp</a> *gp; <span class="comment">// Pointer to a GP predictor for active selection of subset</span></div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;  Int blk_num;  <span class="comment">// Number of blocks</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;  Int samp_num; <span class="comment">// Number of samples </span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;  FILE *logfp;  <span class="comment">// Log file</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">  166</a></span>&#160;  <a class="code" href="classpgpr__domain.html">pgpr_domain</a> *<a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>;</div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">  168</a></span>&#160;  <a class="code" href="classpgpr__matrix.html">Mint</a> <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>;</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div>
<div class="line"><a name="l00176"></a><span class="lineno"><a class="line" href="classpgpr__data.html#aa6879cea28bfba9c8a3fbd87df02a92c">  176</a></span>&#160;  <a class="code" href="classpgpr__data.html#aa6879cea28bfba9c8a3fbd87df02a92c">pgpr_data</a>(<a class="code" href="classpgpr__parse.html">pgpr_parse</a> cfg, Int an, Int tn): blk_num(an), samp_num(tn) {</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;    <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>.resize(samp_num+1, an);</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;    <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a> = <span class="keyword">new</span> <a class="code" href="classpgpr__domain.html">pgpr_domain</a>(cfg.<a class="code" href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">m_connect</a>, cfg.<a class="code" href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">m_xyz</a>);</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;    gp = <span class="keyword">new</span> <a class="code" href="classpgpr__fgp.html">pgpr_fgp</a>(cfg.<a class="code" href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">v_hyp</a>, (Int)cfg.<a class="code" href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">v_param</a>[INP]);</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;    gst = <span class="keyword">new</span> <a class="code" href="structt__state.html">t_state</a>(<a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">ds</a>);</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;   </div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;        <span class="comment">// As the active selection tends to be long, it&#39;s better that the</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        <span class="comment">// progress are recorded in a log.</span></div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;    logfp = fopen(<span class="stringliteral">&quot;pgpr_data.log&quot;</span>, <span class="stringliteral">&quot;w&quot;</span>);</div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;    <span class="keywordflow">if</span> (NULL == logfp) {</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;      <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;failed to open log file\n&quot;</span>);</div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;    }</div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;    setlinebuf(logfp);</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;  </div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;    }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160;</div>
<div class="line"><a name="l00197"></a><span class="lineno"><a class="line" href="classpgpr__data.html#accb6162698eefa8c8826205a21ad18ab">  197</a></span>&#160;  Int <a class="code" href="classpgpr__data.html#accb6162698eefa8c8826205a21ad18ab">getTestSet</a>(Int tsize, <a class="code" href="classpgpr__matrix.html">Mdoub</a> &amp;test) {</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;    test.resize(tsize, <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">dd</a>);</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;    <span class="keywordflow">for</span> (Int i = 0; i &lt; tsize; i++) {</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;      Int pos  = <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">selRand</a>(gst);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;      <span class="keywordflow">if</span>(pos &lt; 0) {</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;        <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;getTestSet: failed to determine test set \n&quot;</span>);</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;      }</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160;      <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#a55b740e3d3a4a0c5bf86cd14895cd76b">getAttr</a>(pos, test[i]);</div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160;    }</div>
<div class="line"><a name="l00206"></a><span class="lineno">  206</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;  }</div>
<div class="line"><a name="l00208"></a><span class="lineno">  208</span>&#160;</div>
<div class="line"><a name="l00214"></a><span class="lineno"><a class="line" href="classpgpr__data.html#aa826857a19458c7ec5dde1b9109f3b07">  214</a></span>&#160;  Int <a class="code" href="classpgpr__data.html#aa826857a19458c7ec5dde1b9109f3b07">getTrainSet</a>(Int mode) {</div>
<div class="line"><a name="l00215"></a><span class="lineno">  215</span>&#160;    <span class="keywordflow">switch</span>(mode) {</div>
<div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;    <span class="keywordflow">case</span> ALGO1:</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;      <a class="code" href="classpgpr__data.html#a569dc41fa124c739d28d05d56874d4c4">getRandomBlk</a>();</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;      <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    <span class="keywordflow">case</span> ALGO2:</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      <a class="code" href="classpgpr__data.html#a1b0b0b000a221c160339ea4207910753">getRandomWalk</a>();</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;      <span class="keywordflow">throw</span>(<span class="stringliteral">&quot;The method for selecting observations is invalid\n&quot;</span>);</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;    }</div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;  }</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno"><a class="line" href="classpgpr__data.html#a569dc41fa124c739d28d05d56874d4c4">  240</a></span>&#160;  Int <a class="code" href="classpgpr__data.html#a569dc41fa124c739d28d05d56874d4c4">getRandomBlk</a>() {</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    pmsg(LEV_DBG, stdout, <span class="stringliteral">&quot;Blocking algorithm: simple random clustering\n&quot;</span>);</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;    <span class="comment">//size of bins</span></div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <a class="code" href="classpgpr__vector.html">Vint</a> bs(blk_num, 0);</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;    <span class="comment">//1.central points</span></div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keywordflow">for</span> (Int i = 0; i &lt; blk_num; i++) {</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;      Int pos  = <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">selRand</a>(gst);</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;      <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[0][i] = pos;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;      bs[i]++;</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    }</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;    <span class="comment">//2. observations</span></div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;    <a class="code" href="classpgpr__vector.html">Vdoub</a> dist(blk_num, .0);</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <a class="code" href="classpgpr__vector.html">Vint</a>  ai(blk_num);</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    <span class="keywordflow">for</span>(Int i = 0; i &lt; (samp_num - 1)*blk_num; i++) {</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;      Int ci  = <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">selRand</a>(gst);</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;      <span class="keywordflow">for</span> (Int k = 0; k &lt; blk_num; k++) {</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;        dist[k] = <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#ac24189f56e27aad49dee703f5a58cc9b">getDist</a>(ci, <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[0][k]);</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;        ai[k] = k;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;      }</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;      <span class="comment">//Sort in incr order according to distance to centroid.</span></div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;      bubble_sort(dist, ai);</div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;      <span class="comment">//assign point to a non-full bin</span></div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;      <span class="keywordflow">for</span> (Int k = 0; k &lt; blk_num; k++) {</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;        Int ca = ai[k];</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;        <span class="keywordflow">if</span> (bs[ca] &lt; samp_num) {</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;          <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[bs[ca]][ca] = ci;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;          bs[ca]++;</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;          <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;        }</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;      }</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    }</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;</div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;  }</div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;  </div>
<div class="line"><a name="l00282"></a><span class="lineno"><a class="line" href="classpgpr__data.html#a1b0b0b000a221c160339ea4207910753">  282</a></span>&#160;  Int <a class="code" href="classpgpr__data.html#a1b0b0b000a221c160339ea4207910753">getRandomWalk</a>() {</div>
<div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="comment">// 1. randomly locate</span></div>
<div class="line"><a name="l00284"></a><span class="lineno">  284</span>&#160;    <span class="keywordflow">for</span> (Int i = 0; i &lt; blk_num; i++) {</div>
<div class="line"><a name="l00285"></a><span class="lineno">  285</span>&#160;      <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[0][i] = <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">selRand</a>(gst);</div>
<div class="line"><a name="l00286"></a><span class="lineno">  286</span>&#160;      gst-&gt;<a class="code" href="structt__state.html#ad627540f74cd0836ea8b32ec9dd1c299">upSt</a>(<a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[0][i]);</div>
<div class="line"><a name="l00287"></a><span class="lineno">  287</span>&#160;    }</div>
<div class="line"><a name="l00288"></a><span class="lineno">  288</span>&#160;    <a class="code" href="classpgpr__matrix.html">Mdoub</a> cset;</div>
<div class="line"><a name="l00289"></a><span class="lineno">  289</span>&#160;    <a class="code" href="classpgpr__vector.html">Vdoub</a> util;</div>
<div class="line"><a name="l00290"></a><span class="lineno">  290</span>&#160;    <span class="comment">// 2. loop</span></div>
<div class="line"><a name="l00291"></a><span class="lineno">  291</span>&#160;    <span class="keywordflow">for</span>(Int i = 1; i &lt; samp_num; i++) {</div>
<div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;      pmsg(LEV_DBG, logfp, <span class="stringliteral">&quot;##########:%d\n&quot;</span>, i + 1);</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;      <span class="keywordflow">for</span> (Int j = 0; j &lt; blk_num; j++) {</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        Int prev = <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[i - 1][j];</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;        Int cnum = 0;</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        <span class="comment">//index of candidates</span></div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;        <a class="code" href="classpgpr__vector.html">Vint</a> ci;</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;        cnum = <a class="code" href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">domain</a>-&gt;<a class="code" href="classpgpr__domain.html#ae07953124466fffafd45013bd7917ddd">getNeighbour</a>(prev, ci);</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;        util.assign(cnum, -1);</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;        <span class="comment">//decide next according to utility vector</span></div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;        Int mi = RANI(cnum);</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;        <a class="code" href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">m_sample</a>[i][j] = ci[mi];</div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;      }</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;    }</div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;  }</div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;    </div>
<div class="line"><a name="l00315"></a><span class="lineno"><a class="line" href="classpgpr__data.html#accef69857141cfa9e7b415edab6e2899">  315</a></span>&#160;  Int <a class="code" href="classpgpr__data.html#accef69857141cfa9e7b415edab6e2899">selMaxVar</a>(<a class="code" href="classpgpr__matrix.html">Mdoub</a> dset, Int dnum, Int anum, <a class="code" href="classpgpr__matrix.html">Mdoub</a> &amp;aset) {</div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;    Int ddim = dset.ncols();</div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;    <a class="code" href="classpgpr__vector.html">Vint</a> flag(dnum, 0);</div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    Int pt;</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;    <span class="comment">//1. initialized as empty set </span></div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;    <span class="keywordflow">if</span> (aset.nrows() &lt; anum) {</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;      aset.resize(anum, ddim);</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;    }</div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;    pt = RANI(dnum);</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;    flag[pt] = 1;</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;    takeSamp(dset[pt], aset[0], ddim);</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;        <span class="comment">//2. actively select a point with largest predictive variance </span></div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        <span class="comment">//until the size of set reached a predefined number</span></div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;    <span class="keywordflow">for</span> (Int i = 1; i &lt; anum; i++) {</div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;      <span class="comment">//take the complement set</span></div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;      <a class="code" href="classpgpr__matrix.html">Mdoub</a> rset(dnum - i, ddim);</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;      <a class="code" href="classpgpr__vector.html">Vint</a> rsi(dnum - i, -1);</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;      Int ri = 0;</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;      <span class="keywordflow">for</span> (Int j = 0; j &lt; dnum; j++) {</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        <span class="keywordflow">if</span>(flag[j] == 0) {</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;          takeSamp(dset[j], rset[ri], ddim);</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;          rsi[ri] = j;</div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;          ri++;</div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;        }</div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;      }</div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;      <span class="comment">//select the largest variance</span></div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;      <a class="code" href="classpgpr__vector.html">Vdoub</a> pmu(dnum - i);</div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;      <a class="code" href="classpgpr__vector.html">Vdoub</a> pvar(dnum - i);</div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;      gp-&gt;full_reg(aset, i, rset, rset.nrows(), pmu, pvar);</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;      pt = rsi[argmaxi(pvar)];</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;      flag[pt] = 1;</div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;      takeSamp(dset[pt], aset[i], ddim);</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;    }</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;    <span class="keywordflow">return</span> SUCC;</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;  }</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;};</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="ttc" id="classpgpr__domain_html_a814453a62ebc1ae9b4e420323bf013c2"><div class="ttname"><a href="classpgpr__domain.html#a814453a62ebc1ae9b4e420323bf013c2">pgpr_domain::selRand</a></div><div class="ttdeci">Int selRand(t_state *st)</div><div class="ttdoc">Select randomly an index of a set, which is not selected. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:112</div></div>
<div class="ttc" id="classpgpr__domain_html_ae75100ee1d73c7b7967ffb3fc8cb27c6"><div class="ttname"><a href="classpgpr__domain.html#ae75100ee1d73c7b7967ffb3fc8cb27c6">pgpr_domain::ds</a></div><div class="ttdeci">Int ds</div><div class="ttdoc">size of the domain </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:86</div></div>
<div class="ttc" id="classpgpr__data_html_a1b0b0b000a221c160339ea4207910753"><div class="ttname"><a href="classpgpr__data.html#a1b0b0b000a221c160339ea4207910753">pgpr_data::getRandomWalk</a></div><div class="ttdeci">Int getRandomWalk()</div><div class="ttdoc">Get a set of training data based on random walk. Note that, it is applicable only if the domain conta...</div><div class="ttdef"><b>Definition:</b> pgpr_data.h:282</div></div>
<div class="ttc" id="classpgpr__data_html_aa6879cea28bfba9c8a3fbd87df02a92c"><div class="ttname"><a href="classpgpr__data.html#aa6879cea28bfba9c8a3fbd87df02a92c">pgpr_data::pgpr_data</a></div><div class="ttdeci">pgpr_data(pgpr_parse cfg, Int an, Int tn)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:176</div></div>
<div class="ttc" id="classpgpr__domain_html"><div class="ttname"><a href="classpgpr__domain.html">pgpr_domain</a></div><div class="ttdoc">This class stores the domain data in a matrix manner. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:75</div></div>
<div class="ttc" id="structt__state_html_a42c55e66207116e6e78283fd50414a1c"><div class="ttname"><a href="structt__state.html#a42c55e66207116e6e78283fd50414a1c">t_state::t_state</a></div><div class="ttdeci">t_state(Int ds)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:40</div></div>
<div class="ttc" id="pgpr__fgp_8h_html"><div class="ttname"><a href="pgpr__fgp_8h.html">pgpr_fgp.h</a></div><div class="ttdoc">This file provides the predictor (pgpr_fgp)with full Gaussian Process. </div></div>
<div class="ttc" id="structt__state_html_ac2e30425ac01de134c164fb1f2d11603"><div class="ttname"><a href="structt__state.html#ac2e30425ac01de134c164fb1f2d11603">t_state::init</a></div><div class="ttdeci">void init(Int ds)</div><div class="ttdoc">Initialize the structure. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:49</div></div>
<div class="ttc" id="classpgpr__data_html_a5b77dc4896f54924681a133309dc5206"><div class="ttname"><a href="classpgpr__data.html#a5b77dc4896f54924681a133309dc5206">pgpr_data::domain</a></div><div class="ttdeci">pgpr_domain * domain</div><div class="ttdoc">Pointer to a domain. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:166</div></div>
<div class="ttc" id="classpgpr__data_html_a839a49ca4d5de7973463e6203a7e807f"><div class="ttname"><a href="classpgpr__data.html#a839a49ca4d5de7973463e6203a7e807f">pgpr_data::m_sample</a></div><div class="ttdeci">Mint m_sample</div><div class="ttdoc">Matrix of indices used as training data. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:168</div></div>
<div class="ttc" id="structt__state_html"><div class="ttname"><a href="structt__state.html">t_state</a></div><div class="ttdoc">Status (e.g., modified or not) of a set of elements. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:26</div></div>
<div class="ttc" id="pgpr__type_8h_html"><div class="ttname"><a href="pgpr__type_8h.html">pgpr_type.h</a></div><div class="ttdoc">This file provides important macros, templates, basic data types (e.g., vector, matrix). </div></div>
<div class="ttc" id="classpgpr__data_html_accb6162698eefa8c8826205a21ad18ab"><div class="ttname"><a href="classpgpr__data.html#accb6162698eefa8c8826205a21ad18ab">pgpr_data::getTestSet</a></div><div class="ttdeci">Int getTestSet(Int tsize, Mdoub &amp;test)</div><div class="ttdoc">Get a random subset of data for testing purpose. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:197</div></div>
<div class="ttc" id="structt__state_html_a642a193cb8c429653c7be9805b37cbf3"><div class="ttname"><a href="structt__state.html#a642a193cb8c429653c7be9805b37cbf3">t_state::ss</a></div><div class="ttdeci">Int ss</div><div class="ttdoc">Size of elements whose statuses are changed. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:30</div></div>
<div class="ttc" id="classpgpr__parse_html_aa2dc5cb24f1a14e11db04e129c070697"><div class="ttname"><a href="classpgpr__parse.html#aa2dc5cb24f1a14e11db04e129c070697">pgpr_parse::v_param</a></div><div class="ttdeci">Vdoub v_param</div><div class="ttdoc">Vector of parameters loaded from cfg file. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:94</div></div>
<div class="ttc" id="classpgpr__data_html_aa826857a19458c7ec5dde1b9109f3b07"><div class="ttname"><a href="classpgpr__data.html#aa826857a19458c7ec5dde1b9109f3b07">pgpr_data::getTrainSet</a></div><div class="ttdeci">Int getTrainSet(Int mode)</div><div class="ttdoc">Get a set of training data. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:214</div></div>
<div class="ttc" id="classpgpr__domain_html_a55b740e3d3a4a0c5bf86cd14895cd76b"><div class="ttname"><a href="classpgpr__domain.html#a55b740e3d3a4a0c5bf86cd14895cd76b">pgpr_domain::getAttr</a></div><div class="ttdeci">Int getAttr(Int s, Doub *a)</div><div class="ttdoc">Get the attributes of an input and its corresponding outputs. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:127</div></div>
<div class="ttc" id="classpgpr__parse_html"><div class="ttname"><a href="classpgpr__parse.html">pgpr_parse</a></div><div class="ttdoc">This class parses domain data files, configuration file and commandline of different applications...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:90</div></div>
<div class="ttc" id="structt__state_html_ac9637b03144741bb23da24c8ec61359b"><div class="ttname"><a href="structt__state.html#ac9637b03144741bb23da24c8ec61359b">t_state::getSt</a></div><div class="ttdeci">Bool getSt(Int s)</div><div class="ttdoc">Get the status of a specific element. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:58</div></div>
<div class="ttc" id="classpgpr__vector_html"><div class="ttname"><a href="classpgpr__vector.html">pgpr_vector&lt; Bool &gt;</a></div></div>
<div class="ttc" id="classpgpr__parse_html_a1e1b0be13a510fd547620a8971874407"><div class="ttname"><a href="classpgpr__parse.html#a1e1b0be13a510fd547620a8971874407">pgpr_parse::m_connect</a></div><div class="ttdeci">Mint m_connect</div><div class="ttdoc">Connectivity of the domain data: each row stores the indices of a set of data points that connects to...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:106</div></div>
<div class="ttc" id="pgpr__util_8h_html"><div class="ttname"><a href="pgpr__util_8h.html">pgpr_util.h</a></div><div class="ttdoc">This file contains a collection of useful functions such as macro-like inline functions, debug functions, exception handling, file I/O, and a real-time timer class. </div></div>
<div class="ttc" id="classpgpr__fgp_html"><div class="ttname"><a href="classpgpr__fgp.html">pgpr_fgp</a></div><div class="ttdoc">This class provides basic regression function using full GP. </div><div class="ttdef"><b>Definition:</b> pgpr_fgp.h:12</div></div>
<div class="ttc" id="classpgpr__data_html"><div class="ttname"><a href="classpgpr__data.html">pgpr_data</a></div><div class="ttdoc">This class provides functionalities of preparing train data, test set and support set...</div><div class="ttdef"><b>Definition:</b> pgpr_data.h:155</div></div>
<div class="ttc" id="classpgpr__domain_html_ae07953124466fffafd45013bd7917ddd"><div class="ttname"><a href="classpgpr__domain.html#ae07953124466fffafd45013bd7917ddd">pgpr_domain::getNeighbour</a></div><div class="ttdeci">Int getNeighbour(Int s, Vint &amp;c)</div><div class="ttdoc">Get a set of indices corresponding to the set of inputs which connected with a specific input...</div><div class="ttdef"><b>Definition:</b> pgpr_data.h:139</div></div>
<div class="ttc" id="classpgpr__matrix_html"><div class="ttname"><a href="classpgpr__matrix.html">pgpr_matrix&lt; Doub &gt;</a></div></div>
<div class="ttc" id="pgpr__parse_8h_html"><div class="ttname"><a href="pgpr__parse_8h.html">pgpr_parse.h</a></div><div class="ttdoc">This file provides functionalities to parse commandlines of different applications and domain files...</div></div>
<div class="ttc" id="structt__state_html_ad627540f74cd0836ea8b32ec9dd1c299"><div class="ttname"><a href="structt__state.html#ad627540f74cd0836ea8b32ec9dd1c299">t_state::upSt</a></div><div class="ttdeci">void upSt(Int s)</div><div class="ttdoc">Set the status of a specific element. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:66</div></div>
<div class="ttc" id="structt__state_html_ab8fb1cce21d366d18a4b6c40161286bc"><div class="ttname"><a href="structt__state.html#ab8fb1cce21d366d18a4b6c40161286bc">t_state::v_st</a></div><div class="ttdeci">Vbool v_st</div><div class="ttdoc">Status of a set of elements. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:28</div></div>
<div class="ttc" id="classpgpr__domain_html_ac527084df0c657962f29a554da0b3eea"><div class="ttname"><a href="classpgpr__domain.html#ac527084df0c657962f29a554da0b3eea">pgpr_domain::pgpr_domain</a></div><div class="ttdeci">pgpr_domain(Mint n, Mdoub a)</div><div class="ttdoc">Constructor. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:92</div></div>
<div class="ttc" id="classpgpr__domain_html_ac24189f56e27aad49dee703f5a58cc9b"><div class="ttname"><a href="classpgpr__domain.html#ac24189f56e27aad49dee703f5a58cc9b">pgpr_domain::getDist</a></div><div class="ttdeci">Doub getDist(Int ci, Int cj)</div><div class="ttdoc">Compute the Euclidean distance between a pair of inputs. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:101</div></div>
<div class="ttc" id="classpgpr__parse_html_afca0013fbaf5205abef333d22f0bcdf4"><div class="ttname"><a href="classpgpr__parse.html#afca0013fbaf5205abef333d22f0bcdf4">pgpr_parse::v_hyp</a></div><div class="ttdeci">Vdoub v_hyp</div><div class="ttdoc">Vector of hyperparameters loaded from cfg file. </div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:96</div></div>
<div class="ttc" id="classpgpr__domain_html_a15bec9baded2abd76ff7d2b58fd6eacf"><div class="ttname"><a href="classpgpr__domain.html#a15bec9baded2abd76ff7d2b58fd6eacf">pgpr_domain::dd</a></div><div class="ttdeci">Int dd</div><div class="ttdoc">dimension of the domain (dimension of inputs and outputs). </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:84</div></div>
<div class="ttc" id="classpgpr__parse_html_ad68cc51bfd6c7c8193039f51b641e01d"><div class="ttname"><a href="classpgpr__parse.html#ad68cc51bfd6c7c8193039f51b641e01d">pgpr_parse::m_xyz</a></div><div class="ttdeci">Mdoub m_xyz</div><div class="ttdoc">Matrix storing domain data where no. of rows indicates the size of domain and no. of columns is the d...</div><div class="ttdef"><b>Definition:</b> pgpr_parse.h:99</div></div>
<div class="ttc" id="classpgpr__data_html_accef69857141cfa9e7b415edab6e2899"><div class="ttname"><a href="classpgpr__data.html#accef69857141cfa9e7b415edab6e2899">pgpr_data::selMaxVar</a></div><div class="ttdeci">Int selMaxVar(Mdoub dset, Int dnum, Int anum, Mdoub &amp;aset)</div><div class="ttdoc">Actively select an informative subset of points. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:315</div></div>
<div class="ttc" id="classpgpr__data_html_a569dc41fa124c739d28d05d56874d4c4"><div class="ttname"><a href="classpgpr__data.html#a569dc41fa124c739d28d05d56874d4c4">pgpr_data::getRandomBlk</a></div><div class="ttdeci">Int getRandomBlk()</div><div class="ttdoc">Get a set of training data based on a simple clustering scheme. </div><div class="ttdef"><b>Definition:</b> pgpr_data.h:240</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Mon Jan 5 2015 14:32:10 for Parallel Gaussian Process Regression by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.7
</small></address>
</body>
</html>
